').hide().appendTo('body');
var arr = jQuery('a.sb-woo-images');
var large_image = '';
jQuery.each(arr, function (i) {
if (large_image = jQuery(this).data('large_image')) {
jQuery('
').appendTo($gallery);
}
});
//$gallery.find('a').colorbox({rel: 'wli-clone', open: true});
}
function sb_woo_product_thumb_replace_by_url(large_image, image_object) {
if (jQuery('.single-product .sb_woo_product_image img').attr('src') == large_image) {
return;
}
var parent_object = image_object.closest('.sb_woo_product_image_container');
if (parent_object.length == 0) {
var parent_object = jQuery('.sb_woo_product_image_container');
}
if (parent_object.length) {
parent_object.find('.sb_woo_product_image img').trigger('zoom.destroy'); // remove zoom
parent_object.find('.sb_woo_product_image img.zoomImg').remove(); //remove old zoom image
var image_height = parent_object.find('.sb_woo_product_image img').height();
parent_object.find('.sb_woo_product_image').css('height', image_height + 'px');
parent_object.find('.sb_woo_product_image img').fadeOut(400, function () {
parent_object.find('.sb_woo_product_image img').attr('src', large_image);
parent_object.find('.sb_woo_product_image').imagesLoaded(function () {
var image_height = parent_object.find('.sb_woo_product_image img').height();
parent_object.find('.sb_woo_product_image').css('height', image_height + 'px');
parent_object.find('.sb_woo_product_image img').fadeIn(400, function () {
if (!parent_object.find('.sb_woo_product_image').hasClass('sb_woo_image_disable_zoom')) {
parent_object.find('.sb_woo_product_image').zoom({
callback: function () {
if (!parent_object.find('.sb_woo_product_image').hasClass('sb_woo_image_disable_lightbox')) {
jQuery.each(jQuery('.wli-clone a'), function() {
if (jQuery(this).attr('href') == parent_object.find('.sb_woo_product_image img').attr('src')) {
jQuery(this).remove();
}
});
jQuery('.wli-clone').prepend(jQuery('
'));
//jQuery(this).colorbox({ href: parent_object.find('.sb_woo_product_image img').attr('src') });
parent_object.find('.sb_woo_product_image').click(function() {
jQuery('.wli-clone a').colorbox({rel: 'wli-clone', open: true, maxWidth: '95%', maxHeight: '95%', onClosed: function() { sb_woo_cbox_close(); } });
});
}
}
});
} else {
if (!parent_object.find('.sb_woo_product_image').hasClass('sb_woo_image_disable_lightbox')) {
jQuery.each(jQuery('.wli-clone a'), function() {
if (jQuery(this).attr('href') == parent_object.find('.sb_woo_product_image img').attr('src')) {
jQuery(this).remove();
}
});
jQuery('.wli-clone').prepend(jQuery('
'))
parent_object.find('.sb_woo_product_image').click(function() {
jQuery('.wli-clone a').colorbox({rel: 'wli-clone', open: true, maxWidth: '95%', maxHeight: '95%', onClosed: function() { sb_woo_cbox_close(); }});
});
//jQuery('.sb_woo_product_image').colorbox({ href: parent_object.find('.sb_woo_product_image img').attr('src') });
}
}
});
});
});
} else {
jQuery.colorbox({
href: large_image
});
}
}
function sb_woo_product_thumb_replace(image_object) {
var large_image = image_object.data('large_image');
sb_woo_product_thumb_replace_by_url(large_image, image_object);
};